<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('AdminJubao/index')}">举报管理</a></li>
        <li class="active"><a href="#">举报详情</a></li>
    </ul>
    <div class="row margin-top-20">

        <div class="col-md-6">
            <form class="js-ajax-form" name="detailForm" action="{:url('AdminJubao/reply')}" method="post">
                <div class="tab-content">
                    <div class="tab-pane active" id="A">
                        <div class="form-group">
                            <label for="input-parent">举报时间</label>
                            <div>
                                {$data.created_at}
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-parent">举报人信息</label>
                            <div>
                                姓名：{$data.username}
                                电话： {$data.phone}
                                身份证： {$data.idno}

                                ip : {$data.ip}
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-name">被举报人信息</label>
                            <div>
                                姓名：{$data.reported_name}
                                职务： {$data.reported_job}
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name">标题</label>
                            <div>
                                {$data.title}
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-description">举报内容</label>
                            <div>
                                {$data.content}
                            </div>
                        </div>


                        <div class="form-group">
                            <label for="input-description">回复时间</label>
                            <div>
                                <if condition="$data.reply_content neq ''">

                                {$data.reply_time}
                                    <else />未回复
                                </if>
                            </div>
                        </div>

                        <div class="form-group" id="replyContent">
                            <label for="input-description">回复内容</label>
                            <div>
                                <if condition="$data.reply_content neq ''">
                                {$data.reply_content}
                                    <else />
                                    <textarea class="form-control" name="reply_content" style="height: 50px;"></textarea>
                                </if>
                            </div>
                        </div>

                        <div class="form-group" id="editReply" style="display: none">
                            <label>编辑回复</label>
                            <div>
                                <textarea class="form-control" name="reply_content" id="replyContentArea" style="height: 50px;"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label >附件</label>
                            <div class="attach">
                                <if condition="$data.attachlist">
                                <ul>
                                    <volist name="data.attachlist" id="vo">
                                    <li><a href="__ROOT__/{$vo.path}">{$vo.filename}</a></li>
                                    </volist>
                                </ul>
                                    <else />
                                    无
                                </if>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="{$data.id}">
                    </div>

                </div>
                <div class="form-group">
                    <if condition="$data.reply_content eq ''">

                    <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('回复')}</button>
                    <else />
                        <button type="button" class="btn btn-primary" id="editReplyBtn">编辑回复</button>
                    </if>
                    <a href="{:url('AdminJubao/delete',array('id'=>$data['id']))}" class="btn btn-danger js-ajax-delete">{:lang('DELETE')}</a>

                    <a class="btn btn-default" href="{:url('AdminJubao/index')}">{:lang('BACK')}</a>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script>
    $("#editReplyBtn").click(function () {
        var text = $(this).text();
        if (text =='编辑回复') {
            $("#editReply").show();
            $("#replyContent").hide();
            $("#replyContentArea").html("{$data.reply_content}");
            $(this).addClass('js-ajax-submit');
            $(this).text('回复');
        } else {
            // 提交
            document.detailForm.submit();
        }
    })
</script>
</body>
</html>